//引入jwt
var jwt = require('jsonwebtoken');
//生成token
 /* var token = jwt.sign(
    {"name":"测试3","address":"成都市" },//负载
     'nodejsF75', //秘钥
     { expiresIn: 5*60}// 有效期
     );
console.log(token)  */
//认证
 jwt.verify("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoi5rWL6K-VMyIsImFkZHJlc3MiOiLmiJDpg73luIIiLCJpYXQiOjE2MjY3NjA3MTksImV4cCI6MTYyNjc2MTAxOX0.1iweP57fpLjqG3obaNb1kEf5Qn6ejqEtSpr-9k3t_MU", 
       'nodejsF75', 
       function(err, decoded) {
                if(err){
                console.log(err);
                return ;
                }
          console.log(decoded.name,decoded.address)
  });
 